CC := gcc
fork: 01_fork.c
	-gcc $^ -o $@
	-./$@
	-rm $@

fork2: 01_fork2.c
	-gcc $^ -o $@
	-./$@
	-rm $@

vm: 00_vm.c
	-gcc $^ -o $@
	-./$@
	-rm $@

other: 02_other.c
	-gcc $^ -o $@

execve: 02_execve.c other
	-gcc $< -o $@
	-./$@
	-rm $@ $(word 2, $^)

execve2: 02_execve2.c
	-gcc $^ -o $@
	-./$@
	-rm $@
# $<: 依赖列表的第一个

pipe: 04_pipe.c
	-gcc $^ -o $@
	-./$@
	-rm $@

share_memory: 05_share_memory.c
	-gcc $^ -o $@
	-./$@
	-rm $@


mqueue: 06_mqueue.c
	-gcc $^ -o $@
	-./$@
	-rm $@

producer: 07_producer.c
	$(CC) -o $@ $^

consumer: 07_consumer.c
	$(CC) -o $@ $^

.PHONY: pc

pc: producer consumer

signal: 08_signal.c
	-gcc $^ -o $@
	-./$@
	-rm $@

shm: 09_shm.c
	-gcc $^ -o $@
	-./$@
	-rm $@

sem_count: 10_sem_count.c
	-gcc $^ -o $@
	-./$@
	-rm $@